                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>请假管理</title>
    <link rel="stylesheet" th:href="@{/bootstrap/bootstrap-3.3.7-dist/css/bootstrap.min.css}"/>
    <link rel="stylesheet" th:href="@{/css/model.css}"/>
    <script th:src="@{/js/jquery-3.2.1.min.js}"></script>
    <style>
        #qjsq{
            position: absolute;
            margin: 0 auto;
            margin: -120px 260px;
            display: none;
        }
        .unapproved{
            color: red;
        }
        .approved{
            color: #00F7DE;
        }
    </style>
</head>
<body>
    <div class="container-fluid">
        <ol class="breadcrumb nav-top">
            <li><a th:href="@{~/router/index.html}" >首页</a></li>
            <li class="active">请假管理</li>
        </ol>
        <!-- <form class="form-inline">
            <div class="form-group">
              <label for="teaName">姓名：</label>
              <input type="text" class="form-control" id="teaName" placeholder="请输入教师姓名">
            </div>
            <button type="submit" class="btn btn-primary">查询</button>
        </form> -->
        <button id="sq" class="btn btn-primary">请假</button>
        <table class="table table-striped tb">
            <thead>
                <tr class="text-center">
                    <td>姓&nbsp;名</td>
                    <td>请假原因</td>
                    <td>请假日期</td>
                    <td>请假天数</td>
                    <td>状&nbsp;态</td>
                </tr>
            </thead>
            <tbody>
                <tr class="text-center" th:each="leave : ${leaveList}">
                    <td th:text="${leave.stuName}">小王</td>
                    <td th:text="${leave.lebecause}">生病</td>
                    <td th:text="${#dates.format(leave.letime,'yyyy-MM-dd')}">2019-9-1</td>
                    <td th:text="${leave.ledays + '天'}">3天</td>
                    <td th:class="${leave.lestate == 0?'unapproved':'approved'}" th:text="${leave.lestate == 0 ? '未批准':'批准'}">未批准</td>
                </tr>
            </tbody>
            
        </table>
        <div class="text-center">
            <nav aria-label="Page navigation">
                <ul class="pagination">
                  <li>
                    <a th:href="@{/leave/getAllLeave.html(currentPage=${pageUtil.currentPage==1?1:pageUtil.currentPage - 1})}" aria-label="Previous">
                      <span aria-hidden="true">&laquo;</span>
                    </a>
                  </li>
                  <li th:each="num : ${#numbers.sequence(1,pageUtil.totalPage)}">
                      <a th:href="@{/leave/getAllLeave.html(currentPage=${num})}" th:text="${num}">1</a>
                  </li>
                  <li>
                    <a th:href="@{/leave/getAllLeave.html(currentPage=${pageUtil.currentPage==pageUtil.totalPage?pageUtil.totalPage:pageUtil.currentPage + 1})}" aria-label="Next">
                      <span aria-hidden="true">&raquo;</span>
                    </a>
                  </li>
                </ul>
              </nav>
        </div>
    </div>

    <!--模态框-->
    <div class="" id="qjsq">
        <div class="panel-body model-content">
            <button type="button" class="close" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <!--<hr>-->
            <form id="imgfile" action="/leave/addLeave" method="post" class="form-inline align-self-center">
                <input type="hidden" name="stuId" th:value="${session.student.sid}"/>
                <input type="hidden" name="approved" th:value="${session.student.pid}"/>
                <div>
                    <label for="dname">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</label>
                    <input  name="stuName" id="dname"/>
                </div>
                <div>
                    <label for="because">请假原因：</label>
                    <input id="because" name="lebecause"/>
                </div>
                <div >
                    <label for="date">请假时间：</label>
                    <input type="date" value="" name="letime" id="date"/>
                </div>
                <div >
                    <label for="days">请假天数：</label>
                    <input type="text" name="ledays" id="days"/>
                </div>
                <div class="">
                    <div class="">
                        <button type="submit" class="btn btn-info">申请</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
<script>
    // .css("display","none");
    $(function(){
        $("#sq").click(function(){
            $("#qjsq").toggle();
        })
        $(".close").click(function(){
            $("#qjsq").hide()
        });

    })
</script>



</body>
</html>